import request from '@/utils/request'

export function login(data) {
    return request({
        url: '/api/passport/login',
        method: 'post',
        data
    })
}
export function taskList(params) {
    return request({
        url: '/api/user.task/list',
        method: 'get',
        params
    })
}

export function taskStart(params) {
    return request({
        url: '/api/user.task/start',
        method: 'get',
        params
    })
}
export function taskClose(params) {
    return request({
        url: '/api/user.task/close',
        method: 'get',
        params
    })
}
export function taskDelect(params) {
    return request({
        url: '/api/user.task/deleted',
        method: 'get',
        params
    })
}
export function taskDel(params) {
    return request({
        url: '/api/user.task_item/deleted',
        method: 'get',
        params
    })
}
export function articleList(params) {
    return request({
        url: '/api/user.site_article/list',
        method: 'get',
        params
    })
}

export function articleDetail(params, data) {
    return request({
        url: '/api/user.site_article/detail',
        method: 'post',
        params,
        data
    })
}
export function task_item(data) {
    return request({
        url: '/api/user.task_item/add',
        method: 'post',
        data
    })
}
// 保存文章
export function edit_site_article(data, id) {
    return request({
        url: '/api/user.site_article/edit',
        method: 'post',
        data,
        params: {
            siteArticleId: id
        }
    })
}
// 保存并发布
export function release_site_article(data, id) {
    return request({
        url: '/api/user.site_article/release',
        method: 'post',
        data,
        params: {
            siteArticleId: id
        }
    })
}
// 配置裁剪
export function task_config_update(data, id) {
    return request({
        url: '/api/user.task_config/update',
        method: 'post',
        data,
        params: {
            configId: id
        }
    })
}
